home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / Tcl_RecordAndEval.man < prev    next >
Text File  |  1991-10-09  |  3KB  |  69 lines

  1.  
  2.  
  3.  
  4. Tcl_RecordAndEval Tcl Command Language Library  Tcl_RecordAndEval
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_RecordAndEval - save a Tcl command in the history  list,
  12.      then execute it
  13.  
  14. SSYYNNOOPPSSIISS
  15.      ##iinncclluuddee <<ttccll..hh>>
  16.  
  17.      int
  18.      TTccll__RReeccoorrddAAnnddEEvvaall(_i_n_t_e_r_p, _c_m_d, _f_l_a_g_s)
  19.  
  20. AARRGGUUMMEENNTTSS
  21.      Tcl_Interp   *_i_n_t_e_r_p    (in)      Interpreter  in  which  to
  22.                                        record   and  execute  the
  23.                                        command.
  24.  
  25.      char         *_c_m_d       (in)      Command  (or  sequence  of
  26.                                        commands) to execute.
  27.  
  28.      char         _f_l_a_g_s      (in)      Flags to pass to  TTccll__EEvvaall
  29.                                        (normally 0).  If -1, then
  30.                                        the command  is  not  exe-
  31.                                        cuted;       it's     just
  32.                                        recorded.
  33.  
  34. _________________________________________________________________
  35.  
  36.  
  37. DDEESSCCRRIIPPTTIIOONN
  38.      TTccll__RReeccoorrddAAnnddEEvvaall is invoked to record a command on the his-
  39.      tory list and then execute it.  Programs that do not wish to
  40.      use the history mechanism should not call TTccll__RReeccoorrddAAnnddEEvvaall;
  41.      they    should    call   TTccll__EEvvaall   instead.    Furthermore,
  42.      TTccll__RReeccoorrddAAnnddEEvvaall should only be called with top-level  com-
  43.      mands  typed by the user, since the purpose of history is to
  44.      allow the user to re-issue recently-invoked commands.
  45.  
  46.      This procedure does three  things.   First,  it  initializes
  47.      history  for  the  interpreter  _i_n_t_e_r_p, if this is the first
  48.      call for _i_n_t_e_r_p.  Among other things, this makes the hhiissttoorryy
  49.      command  available  in  _i_n_t_e_r_p.   If TTccll__RReeccoorrddAAnnddEEvvaall isn't
  50.      called for an interpreter then there will be no hhiissttoorryy com-
  51.      mand  in  that interpreter.  Second, TTccll__RReeccoorrddAAnnddEEvvaall saves
  52.      _c_o_m_m_a_n_d in the history list for iinntteerrpp, making a  new  event
  53.      to  hold the command.  Third, TTccll__RReeccoorrddAAnnddEEvvaall executes the
  54.      command by passing it and _f_l_a_g_s to TTccll__EEvvaall.  If _f_l_a_g_s is -1
  55.      then  only  the first two steps are taken;  the command will
  56.      not be executed.
  57.  
  58.  
  59. KKEEYYWWOORRDDSS
  60.      command, event, execute, history, interpreter, record
  61.  
  62.  
  63.  
  64.  
  65. Sprite v.1.0        Printed:  October 9, 1991                   1
  66.  
  67.  
  68.  
  69.